<?php
$callback = $_GET['callback'];
$type = empty($_GET['type']) ? 1 : $_GET['type'];
$title = strtolower($_GET['wd']);

$json_data = array();
if ($type == 1) {
    //搜索推广页面数据
    $json_data['宝马'] = array(
    array(
        'sourceId'  => '231462',
        'title'     => '<font color="#CC0000">宝马</font>钥匙扣5系525li1系3系320li7系X3X4X5X6男士汽车钥匙链',
        'content'   => '专用于<font color="#CC0000">宝马</font>钥匙扣5系525li1系3系320li7系X3X4X5X6男士汽车钥匙链,<font color="#CC0000">宝马</font>专用 完美贴合 新品上市 尊贵品质 高档大气',
        'href'      => 'https://detail.tmall.com/item.htm?id=527135618126&ali_refid=a3_430583_1006:1110025413:N:%E5%AE%9D%E9%A9%AC%E9%92%A5%E5%8C%99%E6%89%A3:9bdc178b4dfe0f409de21cdf5fff4a8c&ali_trackid=1_9bdc178b4dfe0f409de21cdf5fff4a8c',
        'ads'       => 'www.taobao.com'
        )
    );


    $json_data['天猫'] = array(
    array(
        'sourceId'  => '231462',
        'title'     => '<font color="#CC0000">宝马</font>钥匙扣5系525li1系3系320li7系X3X4X5X6男士汽车钥匙链',
        'content'   => '专用于<font color="#CC0000">宝马</font>钥匙扣5系525li1系3系320li7系X3X4X5X6男士汽车钥匙链,<font color="#CC0000">宝马</font>专用 完美贴合 新品上市 尊贵品质 高档大气',
        'href'      => 'https://detail.tmall.com/item.htm?id=527135618126&ali_refid=a3_430583_1006:1110025413:N:%E5%AE%9D%E9%A9%AC%E9%92%A5%E5%8C%99%E6%89%A3:9bdc178b4dfe0f409de21cdf5fff4a8c&ali_trackid=1_9bdc178b4dfe0f409de21cdf5fff4a8c',
        'ads'       => 'www.taobao.com'
        )
    );
} else if($type == 2){
    //搜索页面插入1个数据
    $json_data['宝马'] = array(
        array(
            'sourceId'  => '231462',
            'title'     => '新款<em>宝马</em>X5中网 改装 三色装饰条汽车运动款前网格栅 适用x3x4x6',
            'content'   => '最新款<em>宝马</em>X3x4x5x6中网，台湾进口，高品质拷漆色，不掉色，不变色，改装新潮流！原装卡扣，直接替换即可，安装便捷！本公司支持七天无理由退换货，买回去试试，不喜欢再退呗',
            'href'      => 'https://shop118821463.taobao.com/index.htm',
        	'ads'       => 'www.xiyat.com'
            )
    );


    $json_data['天猫'] = array(
        array(
            'sourceId'  => '231462',
            'title'     => '新款<em>宝马</em>X5中网 改装 三色装饰条汽车运动款前网格栅 适用x3x4x6',
            'content'   => '最新款<em>宝马</em>X3x4x5x6中网，台湾进口，高品质拷漆色，不掉色，不变色，改装新潮流！原装卡扣，直接替换即可，安装便捷！本公司支持七天无理由退换货，买回去试试，不喜欢再退呗',
            'href'      => 'https://shop118821463.taobao.com/index.htm',
        	'ads'       => 'www.xiyat.com'
            )
    );
} else if($type == 3){
    //商品搜索页面【图片】插入1个
    $json_data['宝马'] = array(
        array(
            'sourceId'  => '231462',
            'title'     => '宝马',
            'media'     => 'https://ss0.baidu.com/94o3dSag_xI4khGko9WTAnF6hhy/image/h%3D200/sign=a3d493768101a18befeb154fae2f0761/eaf81a4c510fd9f9ff2a4033232dd42a2834a4ae.jpg',
            'href'      => 'http://image.baidu.com/search/detail?ct=503316480&z=0&word=%E5%AE%9D%E9%A9%AC&pn=3&spn=0&di=0&pi=&rn=1&tn=baiduimagedetail&is=0%2C0&ie=utf-8&oe=utf-8&in=3354&cl=2&lm=-1&cs=1409409912%2C2201858978&os=2857794897%2C919074533&simid=&adpicid=0&fr=ala&fm=&sme=&statnum=car&cg=&bdtype=-1&oriquery=&objurl=http%3A%2F%2Fi1.hexunimg.cn%2F2012-01-25%2Fm_137504792.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fw7p5_z%26e3Bijx7g_z%26e3Bv54AzdH3Fda8d-a8-dcAzdH3F8n0ca90la_z%26e3Bip4s&gsm=0'
            )
    );


    $json_data['天猫'] = array(
        array(
            'sourceId'  => '231462',
            'title'     => '宝马',
            'media'     => 'https://ss0.baidu.com/94o3dSag_xI4khGko9WTAnF6hhy/image/h%3D200/sign=a3d493768101a18befeb154fae2f0761/eaf81a4c510fd9f9ff2a4033232dd42a2834a4ae.jpg',
            'href'      => 'http://image.baidu.com/search/detail?ct=503316480&z=0&word=%E5%AE%9D%E9%A9%AC&pn=3&spn=0&di=0&pi=&rn=1&tn=baiduimagedetail&is=0%2C0&ie=utf-8&oe=utf-8&in=3354&cl=2&lm=-1&cs=1409409912%2C2201858978&os=2857794897%2C919074533&simid=&adpicid=0&fr=ala&fm=&sme=&statnum=car&cg=&bdtype=-1&oriquery=&objurl=http%3A%2F%2Fi1.hexunimg.cn%2F2012-01-25%2Fm_137504792.jpg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fw7p5_z%26e3Bijx7g_z%26e3Bv54AzdH3Fda8d-a8-dcAzdH3F8n0ca90la_z%26e3Bip4s&gsm=0'
            )
    );
}else if($type == 4){
    //搜索右边推广插入1个
    $json_data['宝马'] = array(
        array(
            'sourceId'  => '231462',
            'title'     => '<font color="#CC0000">宝马</font>将亮相第二十届<font color="#CC0000">深圳</font>-香..',
            'content'   => '<font size="-1"><font color="#CC0000">宝马</font>所有车型6月4日—12日深港澳车展齐放送，<font color="#CC0000">宝马</font>厂商，<font color="#CC0000">宝马</font>经销商</font>',
            'href'      => 'https://www.chezhan123.com/act/act_sga_04.html?channel=%B0%D9%B6%C8&action=%B1%A6%C2%ED',
            'ads'       => 'www.chezhan123.com'
            )
    );


    $json_data['天猫'] = array(
        array(
            'sourceId'  => '231462',
            'title'     => '<font color="#CC0000">宝马</font>将亮相第二十届<font color="#CC0000">深圳</font>-香..',
            'content'   => '<font size="-1"><font color="#CC0000">宝马</font>所有车型6月4日—12日深港澳车展齐放送，<font color="#CC0000">宝马</font>厂商，<font color="#CC0000">宝马</font>经销商</font>',
            'href'      => 'https://www.chezhan123.com/act/act_sga_04.html?channel=%B0%D9%B6%C8&action=%B1%A6%C2%ED',
            'ads'       => 'www.chezhan123.com'
            )
    );
}

echo $callback . '(' . json_encode($json_data[$title]) . ')';
?>